//
//  CommunityViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/3/29.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "CommunityViewController.h"
#import "HuDongViewController.h"

@interface CommunityViewController ()

@end

@implementation CommunityViewController

- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self changePage];
   
}

- (void)changePage
{
    self.navigationItem.title = @"社区";
    UIButton *hudongButton = [UIButton buttonWithType:UIButtonTypeSystem];
    hudongButton.backgroundColor = [UIColor cyanColor];
    hudongButton.frame = CGRectMake(100, 100, 100, 100);
    [hudongButton setTitle:@"互动" forState:UIControlStateNormal];
    [hudongButton addTarget:self action:@selector(hudong:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:hudongButton];
    // iOS7.0以后需要这样设置
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:25]};
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:84 / 255.0 green:199 / 255.0 blue:222 / 255.0 alpha:1]];
}

- (void)hudong:(UIButton *)button
{
    HuDongViewController *huDongVC = [[HuDongViewController alloc] init];
    [self.navigationController pushViewController:huDongVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
